using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BUS;
using Utility;
using Entities;
public partial class Admin_Sualoaitour : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }
    protected void btn_sua_Click(object sender, EventArgs e)
    {
        //try
        //{
        int id = int.Parse(Request.QueryString["id"].ToString());
        tbLoaitour  ltour = tbLoaitourBUS .GetByID(id);

        ltour.Tenloaitour  = txt_tenlt.Text;
        tbLoaitourBUS .Update(ltour);

        //catch
        //{
        Response.Redirect("~/Admin/Danhsachloaitour.aspx");
        //}
    }
    private void LoadData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            txt_malt.Text = id.ToString();

            tbLoaitour  lt= tbLoaitourBUS .GetByID(id);
            txt_tenlt.Text =lt.Tenloaitour ;
        }
        catch
        {
            Response.Redirect("~/Admin/Danhsachloaitour.aspx");
        }
    }
}
